package org.zdw.data.structure.sort;

public class SelectSort {

    public static void sort(int[] array){
        int position = 0;
        for(int i=0;i<array.length;i++){
            int j=i+1;
            position=i;
            int temp=array[i];
            for(;j<array.length;j++){
                if(array[j]<temp){
                    temp=array[j];
                    position=j;
                }
            }
            array[position]=array[i];
            array[i]=temp;
        }
    }
}
